package com.itheima.thread4;

public class Demo02 {

    public static void main(String[] args) {

        Thread thread1 = new Thread(() -> {
            for (int i = 0; i < 100; i++) {
                Thread thread = Thread.currentThread();
                String name = thread.getName();
                System.out.println(name + "@@@" + i);
            }
        });
        thread1.setName("小蔡");
        thread1.setPriority(10);
        thread1.start();

        Thread thread2 = new Thread(() -> {
            for (int i = 0; i < 100; i++) {
                Thread thread = Thread.currentThread();
                String name = thread.getName();
                System.out.println(name + "@@@" + i);
            }
        });
        thread2.setName("小黄");
        thread2.setPriority(1);
        thread2.start();
    }
}
